package com.cenwangkeji.resident.ui.adapter;

import android.support.annotation.Nullable;
import android.widget.ImageView;
import android.widget.TextView;

import com.cenwangkeji.resident.R;
import com.cenwangkeji.resident.model.bean.ServicePackageBean;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.lws.basic.utils.common.MyLogger;

import java.util.List;

/**
 * @松 on 2019/11/4 13:58
 */
public class ServicePackageAdpter extends BaseQuickAdapter<ServicePackageBean.DataBean, BaseViewHolder> {
    public ServicePackageAdpter(@Nullable List<ServicePackageBean.DataBean> data) {
        super(R.layout.item_service_package, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, ServicePackageBean.DataBean item) {
        TextView name = helper.getView(R.id.tv_name);
        ImageView iv = helper.getView(R.id.iv);

        if (item.getType()==1){
            iv.setImageResource(R.mipmap.ic_service_item1_buy);
            name.setTextColor(mContext.getResources().getColor(R.color.black_333333));
        }else {
            iv.setImageResource(R.mipmap.ic_service_item1);
            name.setTextColor(mContext.getResources().getColor(R.color.gray_666666));
        }
        name.setText(item.getName());

    }
}
